<template>
  <div class="error">
    <img src="../assets/imgs/kNw3yjX9qD.png" />
    <router-link to="/" class="jump"
      ><el-button type="primary" :loading="true"
        ><span>{{ outtime }}</span
        >S 返回登录页</el-button
      ></router-link
    >
  </div>
</template>

<script>
export default {
  data() {
    return {
      outtime: 5,
    };
  },
  created() {
    // 超时定时器,设置几秒后跳转页面
    let setTime = setInterval(() => {
      this.outtime--;
      if (this.outtime == 0) {
        this.$router.push("/");
        clearInterval(setTime);
      }
    }, 1000);
  },
};
</script>

<style lang="less" scoped>
.error {
  position: relative;
  width: 100%;
  height: 100%;
  img {
    width: 800px;
    position: absolute;
    left: 50%;
    margin-left: -400px;
    top: 50%;
    margin-top: -269px;
  }
  .jump {
    position: absolute;
    top: 75%;
    left: 50%;
    margin-left: -58.5px;
  }
}
</style>